import 'package:demo/component/component_button.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:demo/views/mine/mine_intro_controller.dart';

// 设置签名
class MineIntroView extends GetView<MineIntroController> {
  // 路由地址
  static const String routeName = '/mine_intro';
  const MineIntroView({super.key});

  @override
  Widget build(BuildContext context) {
    Get.lazyPut(() => MineIntroController());
    return Scaffold(
      appBar: AppBar(
        title: const Text('修改签名'),
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(12.0),
        child: Column(
          children: [
            _buildIntro(),
            _buildSubmit(),
          ],
        ),
      ),
    );
  }

  _buildIntro() {
    return TextField(
      maxLines: null,
      keyboardType: TextInputType.text,
      maxLength: 20,
      controller: controller.introController,
      decoration: const InputDecoration(
        hintText: '请输入签名',
      ),
    );
  }

  _buildSubmit() {
    return ComponentButton(
      label: '提  交',
      onTap: () {
        // 提交
        controller.submit();
      },
    );
  }
}
